package requestModels

import "errors"

type QueryNoteList struct {
	Page     int `json:"page"`
	PageSize int `json:"page_size"`
	Start    int `json:"start"`
	End      int `json:"end"`
}

func (receiver QueryNoteList) Isvalidated() error {
	if receiver.Page <= 0 {
		return errors.New("页码参数不合法")
	}
	if receiver.Start+receiver.PageSize != receiver.End || ((receiver.Page-1)*receiver.PageSize)+1 != receiver.Start {
		return errors.New("查询参数不合法")
	}
	return nil
}
